High-efficiency coherent wavelength conversion is important to various areas of science and technology such as LEDs and lasers, spectroscopy, microscopy and quantum information processing. Current technologies employ wavelength converters with bulky nonlinear crystals (e.g. LiNbO3) to convert light at readily available wavelengths to desired wavelengths. Developing ultra-compact converters with dimensions on the scale of the wavelength of light itself (sub-micron to a few microns) has been hampered by the lack of viable design techniques that can identify optimal geometries for such devices. This technique can automatically define optimal geometries that meet the stringent requirements of high-efficiency wavelength conversion in ultra-compact devices. A novel micro-post cavity with alternating material layers deployed in an unusual aperiodic sequence is used to support modes with the requisite frequencies, large lifetimes, small modal volumes, and extremely large overlaps. This leads to orders of magnitude enhancements in second harmonic generation. An important advantage of this technology is faster operational speeds (or more operational bandwidths) over current devices for comparable or even better performance.